package com.akkainaction.helloactor.finalmessage;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 不可变消息
 */
public final class Message implements Serializable {

    private final int visitCount;

    private final List<String> userNames;

    private final Map<String,String> citys;

    public Message(int visitCount, List<String> userNames, Map<String, String> citys) {
        this.visitCount = visitCount;
        this.userNames = Collections.unmodifiableList(userNames);
        this.citys = Collections.unmodifiableMap(citys);
    }

    public int getVisitCount() {
        return visitCount;
    }

    public List<String> getUserNames() {
        return userNames;
    }

    public Map<String, String> getCitys() {
        return citys;
    }

    @Override
    public String toString() {
        return "Message{" +
                "visitCount=" + visitCount +
                ", userNames=" + userNames +
                ", citys=" + citys +
                '}';
    }
}
